package de.tabuma.pm.project.controller;

import de.tabuma.pm.project.entity.Project;
import de.tabuma.pm.project.logik.ProjectFacade;
import de.tabuma.lib.*;
import de.tabuma.pm.*;
import de.tabuma.customer.entity.*;
import de.tabuma.customer.logik.*;

import java.io.*;
import java.util.*;
import java.util.logging.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.google.appengine.api.users.*;

/**
 *
 * @author alefen
 */
public class list extends tabumacontroller {
    
    public list(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void navigate(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        
        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();

        List<Project> pList = ProjectFacade.getList(user.getEmail());
        request.setAttribute(constants.listAttribute, pList);

        List<Customer> cList = CustomerFacade.getCustomer(user.getEmail());
        request.setAttribute(constants.customerList, cList);

    }
}
